import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'app',
    redirect: '/dash',
    component: () => import('@/views/baseRouterView'),
    children: [
      {
        path: '/dash',
        name: 'home',
        component: () =>
          import(/* webpackChunkName: "whitespace" */ '@/views/dash/index.vue'),
      },
    ],
  },
  // 通用页面
  {
    path: '/login',
    name: 'login',
    component: () =>
      import(/* webpackChunkName: "whitespace" */ '@/views/login/index.vue'),
  },
  {
    path: '/404',
    name: '404',
    component: () =>
      import(/* webpackChunkName: "whitespace" */ '@/views/commonPage/404.vue'),
  },
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes,
})

export default router
